package cn.kgm.user.api;

import cn.kgm.core.http.response.R;
import cn.kgm.user.api.factory.UserLoginLogFallbackFactory;
import cn.kgm.user.dto.dto.UserLoginLogSaveDTO;
import cn.kgm.user.dto.dto.UserLoginLogUpdateDTO;
import cn.kgm.user.dto.query.UserLoginLogPageQuery;
import cn.kgm.user.dto.vo.UserLoginLogVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * # 技术改变自己 #
 * 用户登录日志表
 * @author kappi
 * @email yolo.jk@qq.com
 * @date  2024-04-08 13:28:48
 */
@FeignClient(contextId = "userLoginLogFeignApi",
        name = "${spring.application.name}",
        fallbackFactory = UserLoginLogFallbackFactory.class)
public interface UserLoginLogFeignApi {

    /**
     * 分页列表查询用户登录日志表
     */
    @ApiOperation(value = "分页查询", notes = "分页查询用户登录日志表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNo", value = "页码", dataType = "long", paramType = "query", defaultValue = "1"),
            @ApiImplicitParam(name = "pageSize", value = "分页条数", dataType = "long", paramType = "query", defaultValue = "10"),
    })
    @GetMapping(value = "/userLoginLog/page")
    R<IPage<UserLoginLogVO>> page(UserLoginLogPageQuery data);

    /**
     * 根据id查询用户登录日志表详情
     */
    @ApiOperation(value = "查看详情", notes = "根据id查询用户登录日志表详情")
    @GetMapping(value = "/userLoginLog/{id}")
    R<UserLoginLogVO> get(@PathVariable(value = "id") Long id);

    /**
     * 新增用户登录日志表
     */
    @ApiOperation(value = "新增", notes = "新增用户登录日志表")
    @PostMapping("/userLoginLog/save")
    R<Boolean> save(@RequestBody @Validated UserLoginLogSaveDTO data);

    /**
     * 修改用户登录日志表
     */
    @ApiOperation(value = "修改", notes = "修改用户登录日志表")
    @PostMapping("/userLoginLog/update")
    R<Boolean> update(@RequestBody @Validated UserLoginLogUpdateDTO data);

    /**
     * 根据id更新用户登录日志表的删除状态
     */
    @ApiOperation(value = "删除", notes = "根据id更新用户登录日志表的删除状态")
    @GetMapping(value = "/userLoginLog/delete/{ids}")
    R<Boolean> delete(@PathVariable(value = "ids") Long[] ids);
}

